<template>
  <el-container class="full_box">
    <el-main>
      <el-table
          :data="grades"
          border
          height="100%"
          style="width: 100%">
        <el-table-column
            prop="subject"
            label="科目"
            sortable
            width="200">
        </el-table-column>
        <el-table-column
            prop="date"
            label="日期"
            sortable
            width="200">
        </el-table-column>
        <el-table-column
            prop="grade"
            sortable
            label="成绩 ">
        </el-table-column>
      </el-table>
    </el-main>
  </el-container>

</template>

<script>

//测试数据
//import {testData} from "@/js/testConfig.mjs";
import {getRecentDate,getDataWithDate} from "@/js/util.mjs";

export default {
  name: "GradeTable",
  data() {
    return {
      //元数据
      //metaData:testData,
    }
  },
  computed:{
    grades:function (){
      let date=getRecentDate(this.dateList)
      return getDataWithDate(this.sourceData,date)
    },
    //日期列表
    dateList:function (){
      return this.metaData.dateList
    },
    //所有成绩
    sourceData:function (){
      return this.metaData.grades
    },
    metaData:function (){
      return this.$store.state.student_baseData
    }
  },

}
</script>

<style scoped>

</style>